package com.yeban.base.day03;

import java.util.Scanner;

/**
 * @Desc TODO
 * @Author yeban
 * @Date 2025/9/27
 */
public class For_work01 {

    public static void main(String[] args) {

        //提示需要输出n行金字塔
        Scanner sc = new Scanner(System.in);
        System.out.print("金字塔行数：");
        int n = sc.nextInt();

        //输出金字塔
        for (int i = 1; i <= n; i++) {

            // 打印空格
            for (int j = 1; j <= n - i; j++) {
                System.out.print(" ");
            }

            // 打印*数
            for (int k = 1; k <= 2 * i- 1; k++) {
                System.out.print("*");
            }

            // 一层打印完，换行
            System.out.println();
        }

    }
}
